import { createRouter, createWebHistory } from 'vue-router'

const routes = [
    {
        path: '/',
        redirect: '/index'
    },
    {
        path: '/index',
        component: () => import('./page/index.vue')
    }
]
const router = createRouter({
    history: createWebHistory(),
    routes,
    mode: 'history',
    scorllBehavior(to, from, saveTop) {
        if (saveTop) {
            return saveTop;
        } else {
            return { x: 0, y: 0 }
        }
    },
})

export default router